  void delete_fd(int nfd) { 
    for(int i=0;i<(int)plotter.size();i++) { // remove refering plotters
      string pname=remove_char(plotter[i]->plotdata.name,'*');
      pname=pname.substr(0,pname.find(':'));
      if(pname==fd[nfd]->name) {
        delete plotter[i];
        plotter.erase(plotter.begin()+i);
        if(currentplot>=i)currentplot--;
        i--;
      }
    }
    
    delete fd[nfd];
    fd.erase(fd.begin()+nfd);
    if(current>nfd)current++;
    else if(current==nfd) current=0;
    say("domain deleted");
  }
